﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PubData.aspx.cs" Inherits="SysManage_PubData" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>数据字典管理</title>
    <script src="../Scripts/jquery-1.8.3.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-ui-1.9.2.custom.min.js" type="text/javascript"></script>
    <script src="../Scripts/PubData.js" type="text/javascript"></script>
   <link rel="stylesheet" href="../Content/redmond/jquery-ui-1.9.2.custom.min.css"
        type="text/css" />
    <link rel="stylesheet" href="../Content/SysManage.css" type="text/css" /> 
</head>
<body>
    <form id="form1" runat="server">
        <div class="ContentDiv">
            <p>
                <label for="Data_Type_I" class="lTitle">
                    数据类型:</label>
                <asp:TextBox ID="Data_Type_I" runat="server" MaxLength="50" CssClass="text ui-widget-content"></asp:TextBox>
                <asp:Button ID="Query_Data" runat="server" Text="查询" OnClick="QueryData_Click" CssClass="BtnLeft" />
                <input type="button" id="Add_Data" value="新增" class="BtnLeft" />
            </p>
            <asp:GridView ID="PubData" runat="server" AutoGenerateColumns="False" EmptyDataText="对不起,未找到相关数据！"
                Width="100%" CssClass="ui-widget ui-widget-content" OnRowCancelingEdit="PubData_RowCancelingEdit"
                OnRowEditing="PubData_RowEditing" OnRowUpdating="PubData_RowUpdating" OnRowDeleting="PubData_RowDeleting">
                <HeaderStyle CssClass="ui-widget-header" />
                <Columns>
                    <asp:TemplateField HeaderText="类型" SortExpression="data_type">
                        <ItemTemplate>
                            <asp:Label ID="Data_Type" runat="server" Text='<%# Bind("data_type") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:Label ID="Data_Type_I" runat="server" Text='<%# Bind("data_type") %>'></asp:Label>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="代码" SortExpression="data_code">
                        <ItemTemplate>
                            <asp:Label ID="Data_Code" runat="server" Text='<%# Bind("data_code") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:Label ID="Data_Code_I" runat="server" Text='<%# Bind("data_code") %>'></asp:Label>                            
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="名称" SortExpression="data_name">
                        <ItemTemplate>
                            <asp:Label ID="Data_Name" runat="server" Text='<%# Bind("data_name") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="Data_Name_T" runat="server" Text='<%# Bind("data_name") %>' MaxLength="200"></asp:TextBox>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="Data_Name_T" ID="V_Data_Name"
                                ErrorMessage="*请输入名称" Display="Dynamic"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="编号" SortExpression="order_num">
                        <ItemTemplate>
                            <asp:Label ID="Order_Num" runat="server" Text='<%# Bind("order_num") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="Order_Num_T" runat="server" Text='<%# Bind("order_num") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="Order_Num_T" ID="VR_Order_Num_T"
                                ErrorMessage="*请输入编号" Display="Dynamic"></asp:RequiredFieldValidator>
                           <asp:RegularExpressionValidator runat="server" ControlToValidate="Order_Num_T" Display="Dynamic"  
                           ValidationExpression="^[1-9]\d*$" ErrorMessage="*编号必须为正整数" ID="V_Order_Num_T">
                           </asp:RegularExpressionValidator>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                        <ItemStyle HorizontalAlign="Right"/>
                        <EditItemTemplate>
                            <asp:Button ID="Modify" runat="server" CausesValidation="true"
                                Text="更新" CommandName="Update" CssClass="ui-button ui-state-default ui-corner-all"/>
                                <asp:Button ID="Cancel" runat="server" CausesValidation="false"
                                Text="取消" CommandName="Cancel" CssClass="ui-button ui-state-default ui-corner-all"/>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Button ID="Edit" runat="server" CausesValidation="false"
                                Text="编辑" CommandName="Edit" CssClass="ui-button ui-state-default ui-corner-all"/>
                            <asp:Button ID="Delete" runat="server" CausesValidation="false"
                                Text="删除" CommandName="Delete" CssClass="ui-button ui-state-default ui-corner-all"
                                 OnClientClick="return confirm('确认删除该数据吗？');"/>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <div style="text-align: right; padding: 5px;">
                <webdiyer:AspNetPager ID="DataPager" runat="server" OnPageChanged="DaraPager_PageChanged">
                </webdiyer:AspNetPager>
            </div>
        </div>
        <div id="AddDataDiv" title="新增数据字典" class="DialogDiv">
            <fieldset class="ui-widget ui-widget-content">
                <p>
                    <label for="Data_Type_A">
                        类型:</label>
                    <asp:TextBox ID="Data_Type_A" runat="server" CssClass="text ui-widget-content ui-corner-all"
                        MaxLength="50"></asp:TextBox></p>
                <p>
                    <label for="Data_Code_A">
                        代码:</label>
                    <asp:TextBox ID="Data_Code_A" runat="server" CssClass="text ui-widget-content ui-corner-all"
                        MaxLength="20"></asp:TextBox></p>
                <p>
                    <label for="Data_Name_A">
                        名称:</label>
                    <asp:TextBox ID="Data_Name_A" runat="server" CssClass="text ui-widget-content ui-corner-all"
                        MaxLength="200"></asp:TextBox>
                </p>
                <p>
                    <label for="Order_Num_A">
                        编号:</label>
                    <asp:TextBox ID="Order_Num_A" runat="server" CssClass="text ui-widget-content ui-corner-all"
                        MaxLength="3"></asp:TextBox></p>
            </fieldset>
            <p class="ActionP">
                <asp:Button ID="BtnCreate" runat="server" Text="新增" OnClick="BtnCreate_Click" />
                <input id="BtnCancel" type="button" value="取消" /></p>
        </div>
    </form>
</body>
</html>
